<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>发布项目</title>
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/work.css" />
	<link rel="stylesheet" href="css/edit/default.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/kindeditor-min.js"></script>
	<script type="text/javascript" src="js/zh_CN.js"></script>
	<script>
		var editor;
		KindEditor.ready(function(K) {
			editor = K.create('textarea[name="content"]', {
				allowFileManager : true
			});
			K('input[name=getHtml]').click(function(e) {
				alert(editor.html());
			});
			K('input[name=isEmpty]').click(function(e) {
				alert(editor.isEmpty());
			});
			K('input[name=getText]').click(function(e) {
				alert(editor.text());
			});
			K('input[name=selectedHtml]').click(function(e) {
				alert(editor.selectedHtml());
			});
			K('input[name=setHtml]').click(function(e) {
				editor.html('<h3>Hello KindEditor</h3>');
			});
			K('input[name=setText]').click(function(e) {
				editor.text('<h3>Hello KindEditor</h3>');
			});
			K('input[name=insertHtml]').click(function(e) {
				editor.insertHtml('<strong>插入HTML</strong>');
			});
			K('input[name=appendHtml]').click(function(e) {
				editor.appendHtml('<strong>添加HTML</strong>');
			});
			K('input[name=clear]').click(function(e) {
				editor.html('');
			});
		});
	</script>
</head>
<body>	
	<!-- 头start -->
	<div id="header">
		<div class="top-line"></div>
		<div class="container">
			<div class="ablock">
				<h1><a href=""></a></h1>
				<div class="chose-city">
                    <span>青岛市</span>
                    <a href="" class="change-city" style="color:#808080">切换城市</a>
                </div>
				<ul class="nav">
					<li><a href="javascript:void(0);">首页</a></li>
					<li><a href="javascript:void(0);">兼职</a></li>
					<li><a href="javascript:void(0);">量身定制</a></li>
					<li><a href="javascript:void(0);">我要借贷</a></li>
					<li><a href="javascript:void(0);">实习</a></li>
					<!-- <li><a href="javascript:void(0);">服务</a></li> -->
					<li><a href="javascript:void(0);">创业</a></li>
					<li class="nav_last"><a href="javascript:void(0);">发布项目</a></li>
				</ul>
				<div class="col-md-6">
		            <div class="header-nav pull-right">
		                <!--登录前-->
		                <ul class="login-before">
	                        <li class="person">
	                        	<a href="">个人中心</a>
	                        	<ul>
	                        		<li><a href="">我的简历</a></li>
	                        		<li><a href="">我的申请</a></li>
	                        		<li><a href="">我的收藏</a></li>
	                        		<li><a href="">安全中心</a></li>
	                        		<li><a href="">退出</a></li>
	                        	</ul>
	                        </li>
	                        <div class="nav-dlmt"></div>
	                        <li><a href="">13691243145</a>（<b class="font-red">2</b>）</li>
	                    </ul>
		            	<ul class="login-after">
		            		<li><a href="">发布兼职</a></li>
		            		<li><a href="">发布简历</a></li>
		            	</ul>
		            </div>
		        </div>
			</div>
		</div>
	</div>
	<!-- 头end -->
	
	<div class="box">
		<div class="contribution">
			<div class="title">投稿</div>
			<div class="main clearfix">
				<form id="subform" class="subform" action="" method="POST">
					<div class="form-group margin-t30">
                        <label for="title" class="control-label">标题</label>
                        <div class="tex_right">
                            <input class="form-control" type="text" name="title" value="" id="title">
                        </div>
                    </div>
                    <div class="form-group txt-detail">
                        <label for="content" class="control-label">内容</label>
                        <div class="tex_right">
                        	<textarea name="content" style="width:670px;height:400px;visibility:hidden;" placeholder="说出你的想法"></textarea>
                        </div>
                    </div>
					<div class="form-group margin-t30">
                        <label for="title" class="control-label">理想合伙人</label>
                        <div class="tex_right">
                            <input class="form-control" type="text" value="" id="partner" placeholder="理想合伙人专业,如：设计、IOS等">
                        </div>
                    </div>
					<div class="form-group upfile">
                        <label for="title" class="control-label">图片上传</label>
                        <div class="tex_right">
                            <div class="file left">
								<b>选择图片</b>
								<input type="file" multiple="" accept="image/*" class="fileElem" onchange="handleFiles(this)">
							</div>
                            <input type="button" value="点击上传"  class="right"/>
							<div id="fileList"></div>
                        </div>
                    </div>
					<div class="form-group margin-t30">
                        <label for="author" class="control-label">姓名</label>
                        <div class="tex_auto">
                            <input class="form-control" type="text" name="author" id="author" value="">
                        </div>
                        <label for="author_txt" class="col-sm-2 control-label">联系电话</label>
                        <div class="tex_auto">
                            <input class="form-control" type="text" id="author_phone" name="sourceurl" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="check_txt" class="col-sm-2 control-label">验证码</label>
                        <div class="tex_auto">
                            <input id="check_txt" class="form-control" type="text" name="seccode" value="">
                        </div>
                        <div class="tex_auto">
                            <div class="code-img">
                                <img src="http://app.iheima.com/?app=system&amp;controller=seccode&amp;action=image" alt="验证码" 	>
                            </div>
                        </div>
                    </div>
                    <div class="btn-warp">
                        <button class="send btn" type="button" id="form-post">提交审核</button>
                    </div>
				</form>
			</div>
		</div>
	</div>
		
	


	<!-- 尾部start -->
	<div id="footer">
		<div class="footer">
			<dl>
				<dt>关于我们</dt>
				<dd><a href="">关于捷城</a></dd>
				<dd><a href="">企业动态</a></dd>
				<dd><a href="">在线反馈</a></dd>
			</dl>
			<div class="line"></div>
			<dl>
				<dt>帮助中心</dt>
				<dd><a href="">常见问题</a></dd>
				<dd><a href="">企业服务</a></dd>
				<dd><a href="">联系我们</a></dd>
			</dl>
			<div class="line"></div>
			<dl>
				<dt>关注我们</dt>
				<dd><a href="">官方微信</a></dd>
				<dd><a href="">新浪微博</a></dd>
				<dd><a href="">腾讯微博</a></dd>
			</dl>
			<div class="line"></div>
			<dl>
				<dt>0631-5666168</dt>
				<dd><a href="">联系我们</a></dd>
			</dl>
		</div>
	</div>
	<!-- 尾部end -->




	
	<script type="text/javascript">
		window.URL = window.URL || window.webkitURL;
		var fileList = document.getElementById("fileList");

		function handleFiles(obj) {
			var files = obj.files,
				img = new Image();
			if(window.URL){
				//File API
				/*alert(files[0].name + "," + files[0].size + " bytes");*/
			    img.src = window.URL.createObjectURL(files[0]); //创建一个object URL，并不是你的本地路径
			    img.width = 190;
			    img.onload = function(e) {
			       window.URL.revokeObjectURL(this.src); //图片加载后，释放object URL
			    }
			    if(fileList.getElementsByTagName('img').length<1){
			    	fileList.appendChild(img);
			    }
			    else{
			    	fileList.innerHTML="";
			    	fileList.appendChild(img);
			    }
			}else if(window.FileReader){
				//opera不支持createObjectURL/revokeObjectURL方法。我们用FileReader对象来处理
				var reader = new FileReader();
				reader.readAsDataURL(files[0]);
				reader.onload = function(e){
					alert(files[0].name + "," +e.total + " bytes");
					img.src = this.result;
					img.width = 190;
			      	fileList.value="";
				    if(fileList.getElementsByTagName('img').length<1){
				    	fileList.appendChild(img);
				    }
				    else{
				    	fileList.innerHTML="";
				    	fileList.appendChild(img);
				    }
				}
			}else{
				//ie
				obj.select();
				obj.blur();
				var nfile = document.selection.createRange().text;
				document.selection.empty();
				img.src = nfile;
				img.width = 190;
				img.onload=function(){
			      alert(nfile+","+img.fileSize + " bytes");
			    }
		      	fileList.value="";
			    if(fileList.getElementsByTagName('img').length<1){
			    	fileList.appendChild(img);
			    }
			    else{
			    	fileList.innerHTML="";
			    	fileList.appendChild(img);
			    }
				//fileList.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src='"+nfile+"')";
			}
		}
	</script>

	<script type="text/javascript">
		$(document).ready(function() {
			$("#form-post").click(function(event) {
				/*var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/; */   
				var myreg=/^0?1[3|4|5|7|8][0-9]\d{8}$/;   
  
				if($.trim($("#title").val())==""){
					alert("项目标题不能为空");
				}
				else if($.trim($("#partner").val())==""){
					alert("理想合伙人不能为空");
				}
				else if($("#fileList").html()==""){
					alert("请上传图片");
				}
				else if($.trim($("#author").val())==""){
					alert("请输入姓名");
				}
				else if($.trim($("#author_phone").val())==""){
					alert("请输入电话");
				}
				else if($.trim($("#check_txt").val())==""){
					alert("请输入验证码");
				}
				else if($.trim($("#author_phone").val())!=""){
					if($("#author_phone").val().length==11){
						if(myreg.test($("#author_phone").val())){
							return;
						}
						else{
							alert("请输入有效的手机号");
						}
					}
					else{
						alert("请输入有效的手机号");
					}

				}
			});
		});
	</script>
</body>
</html>